//
//  WeatherTableViewCell.m
//  FVQuickMessage
//
//  Created by dllo on 16/8/18.
//  Copyright © 2016年 zty. All rights reserved.
//

#import "WeatherTableViewCell.h"

@interface WeatherTableViewCell ()

@property (nonatomic, retain) UILabel *weekLable;

@property (nonatomic, retain) UILabel *tempLabel;

@property (nonatomic, retain) UILabel *weatherLabel;

@end

@implementation WeatherTableViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    
    if (self) {
        
        self.weekLable = [[UILabel alloc] init];
        [self addSubview:_weekLable];
        
        self.tempLabel = [[UILabel alloc] init];
        [self addSubview:_tempLabel];
        
        /*self.weatherImageView = [[UIImageView alloc] init];
        [self addSubview:_weatherImageView];*/
        
        self.weatherLabel = [[UILabel alloc] init];
        [self addSubview:_weatherLabel];
        
    }
    
    return self;
    
}

-(void)layoutSubviews {
    
    self.weekLable.frame = CGRectMake(20, 0, self.contentView.bounds.size.width / 3 - 40, 50);
    self.weekLable.textColor = [UIColor whiteColor];
    
    self.tempLabel.frame = CGRectMake(self.contentView.bounds.size.width * 2 / 3 + 40, 0, self.contentView.bounds.size.width / 3 - 40, 50);
    self.tempLabel.textColor = [UIColor whiteColor];
    
    /*self.weatherImageView.frame = CGRectMake(_weekLable.bounds.size.width + 20, 0, self.contentView.bounds.size.width / 3 - 40, 50);
    self.weatherImageView.backgroundColor = [UIColor redColor];*/
    
    self.weatherLabel.frame = CGRectMake(_weekLable.bounds.size.width + 40, 0, self.contentView.bounds.size.width / 3 - 40, 50);
    self.weatherLabel.textColor = [UIColor whiteColor];
    
}

-(void)setWeatherModel:(WeatherModel *)weatherModel {
    
    _weatherModel  = weatherModel;
    
    self.weekLable.text = weatherModel.week;
    
    self.tempLabel.text = weatherModel.temp_high;
    
    self.weatherLabel.text = weatherModel.weather;
    
}

@end
